﻿//INSTANT C# NOTE: Formerly VB.NET project-level imports:
using System.Linq;
using System.Xml.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;

using System.ComponentModel;

namespace DataBinding
{
	public class Person : INotifyPropertyChanged
	{

	#region  Declarations 

		private string _strFirstName = string.Empty;
		private string _strLastName = string.Empty;
		private Nullable<System.DateTime> _datBirthday;
		private string _strProfession = string.Empty;
		private bool _bolIsActive = false;
		private string _strThumbnail = string.Empty;

	#endregion

	#region  Events 

		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

	#endregion

	#region  Properties 

		public string FirstName
		{
			get
			{
				return _strFirstName;
			}
			set
			{
				_strFirstName = value;
				OnPropertyChanged("FirstName");
			}
		}

		public string LastName
		{
			get
			{
				return _strLastName;
			}
			set
			{
				_strLastName = value;
				OnPropertyChanged("LastName");
			}
		}

		public Nullable<System.DateTime> Birthday
		{
			get
			{
				return _datBirthday;
			}
			set
			{
				_datBirthday = value;
				OnPropertyChanged("Birthday");
			}
		}

		public string Profession
		{
			get
			{
				return _strProfession;
			}
			set
			{
				_strProfession = value;
				OnPropertyChanged("Profession");
			}
		}

		public bool IsActive
		{
			get
			{
				return _bolIsActive;
			}
			set
			{
				_bolIsActive = value;
				OnPropertyChanged("IsActive");
			}
		}

		public string Thumbnail
		{
			get
			{
				return _strThumbnail;
			}
			set
			{
				_strThumbnail = value;
				OnPropertyChanged("Thumbnail");
			}
		}

	#endregion

	#region  Constructors 

		public Person()
		{

		}

	#endregion

	#region  Methods 

		protected void OnPropertyChanged(string strPropertyName)
		{

			if (this.PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(strPropertyName));
			}

		}

		//Note:  ToString is NOT dynamically updated in the UI like an INotifyPropertyChanged property
		public override string ToString()
		{
			return string.Concat(_strFirstName, " ", _strLastName);
		}

	#endregion

	}

} //end of root namespace